package org.chen.client;

import org.chen.config.VideoClientFallback;
import org.chen.domain.dto.VideoStatisticsDTO;
import org.chen.domain.vo.VideoTaskVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@FeignClient(name = "video-video", fallback = VideoClientFallback.class)
public interface VideoClient {
    
    @GetMapping("/api/v1/statistics")
    VideoStatisticsDTO getStatistics();
    
    @GetMapping("/api/v1/tasks/recent")
    List<VideoTaskVO> getRecentTasks(@RequestParam(defaultValue = "5") int limit);
    
    @GetMapping("/api/v1/tasks/trend")
    Map<String, Integer> getTaskTrend(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") LocalDateTime startTime,
                                      @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") LocalDateTime endTime);
}